package com.bzsg.rightsManagementSystem.dao

import org.apache.ibatis.annotations.Delete
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Mapper

@Mapper
interface RolePermissionRelationDao {
    @Insert(
        "  insert into role_permission_relation(role_id, permission_id)\n" +
                "        values (#{roleId}, #{permissionId})"
    )
    fun addRolePermissionRelation(roleId: Int, permissionId: Int)

    @Delete(
        "    delete\n" +
                "        from role_permission_relation\n" +
                "        where role_id = #{roleId}"
    )
    fun deleteAllRolePermissionRelationByRoleId(roleId: Int)
}